package service.admin.impl;

import dao.admin.CardListDao;
import dao.admin.impl.CardListDaoImpl;
import entity.Borrow_books;
import entity.Borrow_card;
import entity.Pages;
import service.admin.CardListService;

import java.util.List;

/**
 * CardListServiceImpl
 *
 * @author lenovo
 * @since 2023/9/4
 */
public class CardListServiceImpl implements CardListService {

    //引入数据访问层
    CardListDao dao = new CardListDaoImpl();

    @Override
    public List<Borrow_card> getList(String condition, String conditionValue, Pages<Borrow_card> pages) {
        int pageSize = pages.getPageSize();
        int pageIndex = (pages.getPageCountNo() - 1) * pageSize;
        return dao.getList(condition,conditionValue,pageIndex,pageSize);
    }

    @Override
    public int totalCount(String condition, String conditionValue) {
        return dao.totalCount(condition,conditionValue);
    }
}
